<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
?>
<?php if($this->getProductData()->getId()): ?>
<div class="product-review">
    <div class="page-title">
        <h2><?php echo $this->__('Review Details') ?></h2>
    </div>
    <div class="product-img-box">
        <a href="<?php echo $this->getProductData()->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProductData(), 'small_image')->resize(125, 125); ?>" height="125" width="125" alt="<?php echo $this->htmlEscape($this->getProductData()->getName()) ?>" class="product-image" /></a>
        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
          <p><?php echo $this->__('Average Customer Rating') ?>:</p>
          <?php echo $this->getReviewsSummaryHtml($this->getProductData()) ?>
        <?php endif; ?>
    </div>
    <div class="details">
        <h3 class="product-name"><?php echo $this->htmlEscape($this->getProductData()->getName()) ?></h3>
        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
            <h4><?php echo $this->__('Product Rating:') ?></h4>
            <dl class="ratings-list">
            <?php foreach ($this->getRating() as $_rating): ?>
                <?php if($_rating->getPercent()): ?>
                    <dt><?php echo $this->__($_rating->getRatingCode()) ?></dt>
                    <dd>
                        <div class="rating-box">
                            <div class="rating" style="width:<?php echo ceil($_rating->getPercent()) ?>%;"></div>
                        </div>
                    </dd>
                <?php endif; ?>
                <?php endforeach; ?>
            </dl>
        <?php endif; ?>
        <p><?php echo $this->__('Product Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?></p>
        <p><?php echo nl2br($this->htmlEscape($this->getReviewData()->getDetail())) ?></p>
    </div>
    <div class="buttons-set">
        <a href="<?php echo $this->getBackUrl() ?>" class="back-link">&laquo; <?php echo $this->__('Back to Product Reviews') ?></a>
    </div>
</div>
<?php endif; ?>
